/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package databook.filter;

/**
 *
 * @author zach
 */
public class FilterEvent {
    public final String SELECTION = "SELECTION";
    public final String NORMALIZE = "NORMALIZE";
    public final String THRESHHOLD = "THRESHHOLD";
    public final String HIGHLIGHT_IN = "HIGHLIGHT_IN";
    public final String HIGHLIGHT_OUT = "HIGHLIGHT_OUT";
   
    public String property;
    public String value;
    public boolean visible;
    public boolean normalize;
    public boolean highlightIn;
    public boolean highlightOut;
    public String type;
   
    public FilterEvent() {
        this.type = THRESHHOLD;
    }
    
    public FilterEvent(String prop, String value, boolean visible) {
        this.property = prop;
        this.value = value;
        this.visible = visible;
        type = SELECTION;
    }
   
    public FilterEvent(boolean normalize) {
        this.normalize = normalize;
        type = NORMALIZE;
    }
    
    public FilterEvent(boolean highlight, int direction)
    {
    	if(direction==1)
    	{
    		this.highlightIn = highlight;
    		this.type = HIGHLIGHT_IN;
    	}
    	else
    	{
    		this.highlightOut = highlight;
    		this.type = HIGHLIGHT_OUT;
    	}
    }
    
    public String toString() {
        return this.property + " " + this.value + " " + this.visible;
    }
}
